/* Copyright 2021 Kerim Yalcin
**
**   Licensed under the Apache License, Version 2.0 (the "License");
**   you may not use this file except in compliance with the License.
**   You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
**   Unless required by applicable law or agreed to in writing, software
**   distributed under the License is distributed on an "AS IS" BASIS,
**   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
**   See the License for the specific language governing permissions and
**   limitations under the License.
*/

#ifndef AGX_WINDOWBASE_HEADER
#define AGX_WINDOWBASE_HEADER

#include <string>

#include <windows.h>

namespace Agx {

class WindowBase {
    private:
        bool mIsCreated;
        bool mIsLinked_withFrame;

        HINSTANCE mInstance;
        HWND mHwnd;

    protected:
        RECT mRect;

        std::string mWndClass_Name;
        std::string mWindow_Name;

        DWORD mExtendedStyle;
        DWORD mStyle;
        
        int mPosition_X;
        int mPosition_Y;
        int mWindow_Width;
        int mWindow_Heigth;

        HWND mWindow_Parent;
        HMENU mMenu;

        LPVOID mParam;

    public:
        WindowBase() = delete;
        WindowBase(HINSTANCE pInstance);

        HINSTANCE get_Instance() const;
        HWND get_WindowHandle() const;

        const bool& is_linked_withFrame();
        const bool& is_created();

        virtual void set_Width(const int& pWidth);
        const int& get_Width();
        virtual void change_Width(const int& pWidth_toChange);
        virtual void set_Heigth(const int& pHeight);
        const int& get_Heigth();
        virtual void change_Heigth(const int& pHeigth_toChange);

        virtual void set_X_Position(const int& pX_Pos);
        const int& get_X_Position();
        virtual void change_X_Position(const int& pX_Pos_toChange);
        virtual void set_Y_Position(const int& pX_Pos);
        const int& get_Y_Position();
        virtual void change_Y_Position(const int& pX_Pos_toChange);

        virtual void set_Parent(const HWND pParent) {};
        HWND get_Parent() const;
        virtual void change_Parent(const HWND pParent) {};

        void show();

        void create(LONG_PTR pWindowFrame);
        virtual void draw() {};
};

}

#endif